<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss2">
    <title>新增服务项</title>
</head>
<body>
<div class="layui-fluid">

    <blockquote class="layui-crumb">
        <a lay-href="/service/tariff/list.action">价格表管理&nbsp;&nbsp;</a>/&nbsp;
        <span th:text="${faultTariff.tariffName}"></span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${servCategory.name}"></span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${baseCategory.name}"></span>&nbsp;&nbsp;/&nbsp;
        <span>使用项目</span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${faultGroup.groupAlias}"></span>&nbsp;&nbsp;/&nbsp;
        <span th:text="${faultItem.itemId>1?faultItem.itemName:'新增项目'}"></span>

    </blockquote>

    <div class="layui-card">

        <div th:replace="service/item/_detailtab::tab"></div>

        <div class="layui-card-body">
            <form method="post" action="" class="layui-form" lay-filter="zmn-form">
                <input type="hidden" name="itemId" th:value="${faultItem.itemId}">
                <input type="hidden" name="groupId" th:value="${faultItem.groupId}"/>
                <input type="hidden" name="hasDefaultItem" th:value="${hasDefaultItem}"/>
                <input type="hidden" name="updateMyself" th:value="${updateMyself}"/>
                <!--<input type="hidden" name="bizType" th:value="${faultGroup.bizType}"/>-->
                <input type="hidden" name="tariffId" th:value="${faultGroup.tariffId}"/>
                <input type="hidden" name="serviceMinutes" th:value="${faultItem.serviceMinutes}"/>


                <div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>
                <div class="layui-form-item">
                    <label class="layui-form-label">项目分组：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid">
                            <span th:text="${faultGroup.groupName}"></span>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">项目名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="itemName" id="itemName" lay-filter="name"
                               th:value="${faultItem.itemName}" placeholder="服务项目名称"
                               lay-verify="required" style="width: 300px" autocomplete="off" class="layui-input"
                               maxlength="45"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">项目类型名称：</label>
                    <div class="layui-input-inline">
                        <select name="categId" id="categId" lay-filter="categId" lay-verify="required" lay-search>
                            <option value="">请选择</option>
                            <option th:each="categ:${faultCategs}"
                                    th:value="${categ.categId}" th:selected="${faultItem.categId == categ.categId}"
                                    th:text="${categ.categName}">
                            </option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">单位：</label>
                    <div class="layui-input-inline">
                        <select name="unit" id="unit" lay-filter="unit" lay-verify="required" lay-search>
                            <option value="">请选择</option>
                            <option th:each="unit:${unit}"
                                    th:value="${unit}" th:selected="${faultItem.unit == unit}"
                                    th:text="${unit}">
                            </option>
                        </select>
                    </div>
                </div>
                <!---新增的时候允许设置，新增之后不允许修改一口价相应的数据---->
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">一口价：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="priceStandard" lay-filter="priceStandard" value="2" title="一口价"
                               th:disabled="${faultItem.itemId!=null&&faultItem.itemId >0}"
                               th:checked="${faultItem.priceStandard == 2 || faultItem.itemId == null }">
                        <input type="radio" name="priceStandard" lay-filter="priceStandard" value="1" title="非一口价"
                               th:disabled="${(faultItem.itemId!=null&&faultItem.itemId >0) || ((faultItem.itemId == null || faultItem.itemId == 0) && faultTariff.tariffType == 4)}"
                               th:checked="${faultItem.priceStandard == 1}">
                    </div>
                </div>

                <div class="layui-form-item" id="priceSplitDiv"
                     th:hidden="${(faultItem.itemId != null&&faultItem.itemId >0&&faultItem.priceStandard==1&&faultTariff.tariffType==2)||faultTariff.tariffType==1}">
                    <label class="layui-form-label layui-form-required">是否区分明细：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="priceSplit" lay-filter="priceSplit" value="2" title="区分"
                               th:disabled="${faultItem.itemId!=null&&faultItem.itemId >0}"
                               th:checked="${faultItem.priceSplit == 2 || faultItem.itemId == null }">
                        <input type="radio" name="priceSplit" lay-filter="priceSplit" value="1" title="不区分"
                               th:disabled="${faultItem.itemId!=null&&faultItem.itemId >0}"
                               th:checked="${faultItem.priceSplit == 1}">
                    </div>
                </div>

                <div class="layui-form-item" id="feeDetail"
                     th:hidden="${(faultItem.itemId != null&&faultItem.itemId >0&&faultItem.priceStandard==1&&faultTariff.tariffType==2)||faultTariff.tariffType==1 || faultTariff.tariffType == 4}">
                    <label class="layui-form-label">明细类型：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="priceSplitType" lay-filter="priceSplitType" value="1" title="明细一"
                               th:checked="${faultItem.priceSplitType ==1}">
                        <div class="layui-form-item" id="feeDetail1">
                            <div class="layui-input-inline"
                                 style="color: #999;width: 400px;margin-top: 5px;margin-bottom:5px;line-height: initial;margin-left: 20px;">
                                交通费和工时费为：固定金额，配件包干费为= 销售价 * 百分比 技术服务费=销售价-交通费-工时费-配件包干费
                            </div>
                            <div class="layui-form-item" style="    margin-left: -55px;">
                                <label class="layui-form-label">路途往返费：</label>
                                <div class="layui-input-inline" style="width: 90px;">
                                    <input type="text" name="trafficFee" id="trafficFee"
                                           lay-filter="trafficFee|feeVerify" th:value="${faultItem.trafficFee}"
                                           placeholder="路途往返费"
                                           style="width: 90px" autocomplete="off" class="layui-input editFee"
                                           maxlength="45"/>

                                </div>
                                <label class="layui-form-label"
                                       style="width: 90px;padding-top: 7px;padding-bottom: 7px;padding-left: 0px">工时费：</label>
                                <div class="layui-input-inline" style="width: 90px;">
                                    <input type="text" name="hourFee" id="hourFee"
                                           lay-filter="hourFee|feeVerify" th:value="${faultItem.hourFee}"
                                           placeholder="工时费"
                                           style="width: 90px" autocomplete="off" class="layui-input editFee"
                                           maxlength="45"/>

                                </div>
                                <label class="layui-form-label"
                                       style="width: 90px;padding-top: 7px;padding-bottom: 7px;padding-left: 0px">检测费：</label>
                                <div class="layui-input-inline" style="width: 90px;">
                                    <input type="text" name="checkFee" id="checkFee"
                                           lay-filter="checkFee|feeVerify" th:value="${faultItem.checkFee}"
                                           placeholder="检测费"
                                           style="width: 90px" autocomplete="off" class="layui-input editFee"
                                           maxlength="45"/>

                                </div>
                            </div>
                            <div class="layui-form-item" style="margin-left: -55px;">
                                <label class="layui-form-label">配件包干费：</label>
                                <div class="layui-input-inline" style="width: 90px;">
                                    <input type="text" name="partRatio" id="partRatio" lay-verify="percent"
                                           th:value="${#numbers.formatInteger(faultItem.partRatio,0)}"
                                           placeholder="配件包干费"
                                           style="width: 90px" autocomplete="off" class="layui-input" maxlength="2"/>
                                </div>
                                <div class="layui-input-inline"
                                     style="width: 8px;padding-top: 7px;padding-bottom: 7px;margin-left: -23px;">%
                                </div>
                                <label class="layui-form-label"
                                       style="width: 90px;padding-top: 7px;padding-bottom: 7px;padding-left: 0px">工艺费：</label>
                                <div class="layui-input-inline" style="width: 90px;">
                                    <input type="text" name="artRatio" id="artRatio" lay-verify="percent"
                                           th:value="${#numbers.formatInteger(faultItem.artRatio,0)}" placeholder="工艺费"
                                           style="width: 90px" autocomplete="off" class="layui-input" maxlength="2"/>
                                </div>
                                <div class="layui-input-inline"
                                     style="width: 8px;padding-top: 7px;padding-bottom: 7px;margin-left: -23px;">%
                                </div>
                                <label class="layui-form-label"
                                       style="width: 90px;padding-top: 7px;padding-bottom: 7px;padding-left: 0px">保修费：</label>
                                <div class="layui-input-inline" style="width: 90px;">
                                    <input type="text" name="guaranteeRatio" id="guaranteeRatio"
                                           lay-verify="percent"
                                           th:value="${#numbers.formatInteger(faultItem.guaranteeRatio,0)}"
                                           placeholder="保修费"
                                           style="width: 90px" autocomplete="off" class="layui-input" maxlength="2"/>
                                </div>
                                <div class="layui-input-inline"
                                     style="width: 8px;padding-top: 7px;padding-bottom: 7px;margin-left: -23px;">%
                                </div>
                                <label class="layui-form-label" style="width: 90px;">技术服务费：</label>
                                <div class="layui-input-inline" style="width: 90px;">
                                    <div style="color: #999;padding-top: 7px;padding-bottom: 7px;">系统自动计算</div>

                                </div>
                            </div>
                        </div>
                        <input type="radio" name="priceSplitType" lay-filter="priceSplitType" value="2" title="明细二"
                               th:checked="${faultItem.priceSplitType ==2}">
                        <div class="layui-form-item" id="feeDetail2">
                            <div class="layui-input-inline"
                                 style="color: #999;width: 100%;margin-top: 5px;margin-bottom:5px;line-height: initial;margin-left: 20px;">
                                销售价=材料费*数量+工艺费总计<br/>
                                数量
                                <数量阶梯值时
                                        ，工艺费总计=工艺费*数量<br/>
                                    数量>=数量阶梯值时，工艺费总计 = 工艺费*（1-数量/数量阶梯值*阶梯降幅）*数量 （数量/数量阶梯值的计算结果向下取整；当阶梯价
                                    <底折价格时
                                            ，取底折价格;四舍五入，取整）
                                    <br/>
                            </div>
                            <div class="layui-form-item" style="margin-left: -30px;">

                                <label class="layui-form-label" style="width: 90px;">材料费：</label>
                                <div class="layui-input-inline" style="width: 100px;margin-right: 0px;">
                                    <input type="text" name="materialFee" id="materialFee" lay-verify="positive|percent"
                                           th:value="${#numbers.formatInteger(faultItem.materialFee,0)}"
                                           placeholder="材料费"
                                           style="width: 100px" autocomplete="off" class="layui-input" maxlength="3"/>
                                </div>
                                <div class="layui-input-inline"
                                     style="width: 8px;padding-top: 7px;padding-bottom: 7px;margin-left: -15px;">%
                                </div>
                                <label class="layui-form-label" style="width: 90px;">工艺费：</label>
                                <div class="layui-input-inline" style="width: 100px;margin-right: 0px;">
                                    <input type="text"
                                           th:value="${faultItem.materialFee!=null?#numbers.formatInteger((100-faultItem.materialFee),0):''}"
                                           placeholder="工艺费"
                                           class="layui-input layui-disabled" style="width: 100px" id="factoryFee"
                                           autocomplete="off" disabled maxlength="3"/>
                                </div>
                                <div class="layui-input-inline"
                                     style="width: 8px;padding-top: 7px;padding-bottom: 7px;margin-left: -15px;">%
                                </div>
                                <div class="layui-input-inline"
                                     style="color: #999;width: 40%;margin-top: 5px;margin-bottom:5px;margin-left:20px;line-height: initial;">
                                    单位价格=材料费+工艺费，通过百分占比构成
                                </div>
                            </div>

                            <div class="layui-form-item" style="margin-left: -30px;">

                                <label class="layui-form-label" style="width: 90px;">数量阶梯值：</label>
                                <div class="layui-input-inline" style="width: 100px;margin-right: 0px;">
                                    <input type="text" name="numberStep" id="numberStep" lay-verify="positive|percent"
                                           th:value="${#numbers.formatInteger(faultItem.numberStep,0)}"
                                           placeholder="数量阶梯值"
                                           style="width: 100px" autocomplete="off" class="layui-input" maxlength="3"/>
                                </div>
                                <label class="layui-form-label" style="width: 90px;">阶梯降幅：</label>
                                <div class="layui-input-inline" style="width: 100px;margin-right: 0px;">
                                    <input type="text" name="numberStepDown" id="numberStepDown"
                                           lay-verify="positive|percent"
                                           th:value="${#numbers.formatInteger(faultItem.numberStepDown,0)}"
                                           placeholder="阶梯降幅"
                                           style="width: 100px" autocomplete="off" class="layui-input" maxlength="3"/>
                                </div>
                                <div class="layui-input-inline"
                                     style="width: 8px;padding-top: 7px;padding-bottom: 7px;margin-left: -15px;">%
                                </div>
                                <label class="layui-form-label" style="width: 90px;">底折：</label>
                                <div class="layui-input-inline" style="width: 100px;margin-right: 0px;">
                                    <input type="text" name="baseDiscount" id="baseDiscount"
                                           lay-verify="positive|percent"
                                           th:value="${faultItem.baseDiscount!=null?#numbers.formatInteger(faultItem.baseDiscount,0):''}"
                                           placeholder="底折"
                                           style="width: 100px" autocomplete="off" class="layui-input" maxlength="3"/>
                                </div>
                                <div class="layui-input-inline"
                                     style="width: 8px;padding-top: 7px;padding-bottom: 7px;margin-left: -15px;">%
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div  id="feeDetail3" th:hidden="${faultTariff.tariffType != 4 || faultItem.categId != '3001'}">
                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">验收项目：</label>
                        <div class="layui-input-inline" style="width: 300px">
<!--                            <select name="acceptProjectList" xm-select="acceptProjectList" id="acceptProjectList" lay-filter="acceptProjectList" lay-search>-->
<!--                                <option value="">请选择</option>-->
<!--                                <option th:each="acceptProject:${acceptProjectList}"-->
<!--                                        th:value="${acceptProject.value}" th:selected="${acceptProject.status}"-->
<!--                                        th:text="${acceptProject.text}">-->
<!--                                </option>-->
<!--                            </select>-->
                            <div id="acceptProjectList"></div>
                        </div>
                        <div class="layui-input-inline" style="width: 400px" th:text="${acceptProjectNameList}"></div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">服务内容：</label>
                        <div class="layui-input-inline" style="width: 300px">
<!--                            <select name="serviceContentList"  xm-select="serviceContentList"  id="serviceContentList" lay-filter="serviceItem" lay-search>-->
<!--                                <option value="">请选择</option>-->
<!--                                <option th:each="serviceItem:${serviceContentList}"-->
<!--                                        th:value="${serviceItem.value}" th:selected="${serviceItem.status}"-->
<!--                                        th:text="${serviceItem.text}">-->
<!--                                </option>-->
<!--                            </select>-->
                            <div id="serviceContentList"></div>
                        </div>
                        <div class="layui-input-inline" style="width: 400px" th:text="${serviceContentNameList}"></div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">具体故障：</label>
<!--                        <div class="layui-input-inline" style="width: 500px">-->
<!--                            <select name="faultList"  xm-select="faultList" id="faultList" lay-filter="fault" lay-search>-->
<!--                                <option value="">请选择</option>-->
<!--                                <option th:each="fault:${faultList}"-->
<!--                                        th:value="${fault.value}" th:selected="${fault.selected}"-->
<!--                                        th:text="${fault.label}">-->
<!--                                </option>-->
<!--                            </select>-->
<!--                        </div>-->
                        <div class="layui-input-inline" style="width:300px">
                            <div id="faultList"></div>
                        </div>
                        <div class="layui-input-inline" style="width: 400px" th:text="${faultNameList}"></div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">维修难度：</label>
                        <div class="layui-input-inline">
                            <select name="maintainDifficulty" id="maintainDifficulty">
                                <option value="">请选择</option>
                                <option th:each="entity:${maintainDifficultyList}" th:value="${entity.key}"
                                        th:text="${entity.value}"
                                        th:selected="${entity.key == maintainDifficulty}"/>
                            </select>
                        </div>
                    </div>
                </div>
                <!--   <div class="layui-form-item">
                       <label class="layui-form-label">服务时长：</label>
                       <div class="layui-input-block" style="width: auto">
                           <input type="text" name="service_minutes" id="serviceMinutes" lay-filter="serviceMinutes"
                                  th:value="${faultItem.serviceMinutes}" style="width: 100px;display: inline-block;"
                                  placeholder="" lay-verify="serviceMinutes" autocomplete="off" min="1"
                                  class="layui-input" maxlength="10"/>
                           <span style="color: #999;">对上门-服务完成的时长限制，低于设置的时长不能操作完成订单，不设置表示不限制，没有取到服务项时，取前台二级分类的时长限制，单位：分钟</span>
                       </div>
                   </div>-->

                <div class="layui-form-item">
                    <label class="layui-form-label">最大数量：</label>
                    <div class="layui-input-block" style="width: auto">
                        <input type="text" name="countLimit" id="countLimit" lay-filter="countLimit"
                               th:value="${faultItem.countLimit}" style="width: 100px;display: inline-block;"
                               placeholder="" lay-verify="isPositiveNumber" autocomplete="off" min="1"
                               class="layui-input" maxlength="10"/>
                        <span style="color: #999;">可使用的最大数量，不填和填0表示不限制</span>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">排序：</label>
                    <div class="layui-input-block" style="width: auto">
                        <input type="text" name="sort" autocomplete="off" maxlength="10"
                               style="width: 100px;display: inline-block;" th:value="${faultItem.sort}"
                               class="layui-input" lay-verify="sort|required"
                               onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')">
                        <span style="color: #999;">排序ID越小，排越前面</span>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">项目简介：</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入项目简介,最大500字，选填" th:text="${faultItem.brief}"
                                  style="width: 600px; min-height:120px;" name="brief" class="layui-textarea" maxlength="500">
                        </textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">项目说明：</label>
                    <div class="layui-input-inline" style="width: 540px;">
                        <script id="desc" width="900px" height="500px" name="desc" type="text/plain"></script>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">状态：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="2" title="启用"
                               th:checked="${faultItem.status == 2|| faultItem.itemId == null }">
                        <input type="radio" name="status" value="1" title="禁用"
                               th:checked="${faultItem.status == 1}">
                    </div>
                </div>

                <div class="layui-card-header" style="margin-top:10px;"><b>应用属性</b></div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">默认项目：</label>
                    <div class="layui-input-block" id="defaultProject">
                        <input type="radio" name="general" value="2" title="默认" th:checked="${faultItem.general == 2}">
                        <input type="radio" name="general" value="1" title="非默认"
                               th:checked="${faultItem.general == 1||faultItem.itemId == null}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">互斥性：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="mutexMode" value="1" title="全局互斥"
                               th:checked="${faultItem.mutexMode == 1}">
                        <input type="radio" name="mutexMode" value="2" title="局部互斥"
                               th:checked="${faultItem.mutexMode == 2 }">
                        <input type="radio" name="mutexMode" value="3" title="不互斥"
                               th:checked="${faultItem.mutexMode == 3 }">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">城市系数：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="cityLimit" value="2" title="影响"
                               th:checked="${faultItem.cityLimit == 2}">
                        <input type="radio" name="cityLimit" value="1" title="不影响"
                               th:checked="${faultItem.cityLimit == 1}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">品牌系数：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="brandLimit" value="2" title="影响"
                               th:checked="${faultItem.brandLimit == 2}">
                        <input type="radio" name="brandLimit" value="1" title="不影响"
                               th:checked="${faultItem.brandLimit == 1}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">修改价格：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="manualPrice" value="2" title="允许"
                               th:checked="${faultItem.manualPrice == 2 }">
                        <input type="radio" name="manualPrice" value="1" title="不允许"
                               th:checked="${faultItem.manualPrice == 1 }">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">APP编辑：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="editEnable" value="2" title="编辑"
                               th:checked="${faultItem.editEnable == 2}">
                        <input type="radio" name="editEnable" value="1" title="不编辑"
                               th:checked="${faultItem.editEnable == 1}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">APP显示：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="show" value="2" title="显示" th:checked="${faultItem.show == 2}">
                        <input type="radio" name="show" value="1" title="不显示" th:checked="${faultItem.show == 1}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">前端价格显示：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="showPrice" value="2" title="显示"
                               th:checked="${faultItem.showPrice == 2}">
                        <input type="radio" name="showPrice" value="1" title="不显示"
                               th:checked="${faultItem.showPrice == 1}">
                        <span style="color: #999;">用于控制在用户端价格表中是否显示该项目及其对应价格</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">工程师拍照：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="takePicture" value="2" title="需拍照"
                               th:checked="${faultItem.takePicture == 2}">
                        <input type="radio" name="takePicture" value="1" title="不需拍照"
                               th:checked="${faultItem.takePicture == 1}">
                        <span style="color: #999;">需拍照，则工程师app勾选此项目，需拍照</span>
                    </div>

                </div>
                <div class="layui-form-item submit">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary"
                                onclick="cancel()">取消
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>

<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.js"></script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/static/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="/static/js/commonSelect.js"></script>

<script type="text/javascript" th:inline="javascript">
    var ue = UE.getEditor('desc', {
        initialFrameHeight:300,
        initialFrameWidth:800,
        maximumWords:2000,
        wordCountMsg: "当前已输入 {#count} 个字，您还可以输入{#leave} 个字符"
    });

    UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
    UE.Editor.prototype.getActionUrl = function(action) {
        // 这里很重要，很重要，很重要，要和配置中的imageActionName值一样
        if (action == 'uploadimage') {
            // 这里调用后端我们写的图片上传接口
            return '/ueditor/uploadImageData';
        } else {
            return this._bkGetActionUrl.call(this, action);
        }
    }

    let value = [[${faultItem.desc}]];
    ue.ready(function () {
        ue.execCommand('insertHtml', value);
    });
</script>

<script type="text/javascript">
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('desc').execCommand('insertHtml', value)
    }

    function getContent() {
        var arr = [];
        arr.push(UE.getEditor('desc').getContent());
        return(arr.join("\n"));
    }
</script>

<script type="text/javascript" th:inline="javascript">
    layui.config({
        base: "/static/lay/",
        version: 2011241001241
    }).extend({
        index: "lib/index",
        serv_service_item_detail: "service/item/serv.service.item.detail"
    }).use(['index', 'serv_service_item_detail']);
    let json = {
        item: [[${faultItem}]],
        group: [[${faultGroup}]],
        faultTariff: [[${faultTariff}]],
        acceptProjectList: [[${acceptProjectList}]],
        serviceContentList: [[${serviceContentList}]],
        faultList: [[${faultList}]]
    }
</script>
